/**
 * 获取线程优先级
 */
public class ThreadDemoByPriority {
    public static void main(String[] args) {
        Thread thread=new Thread(new Runnable() {
            @Override
            public void run() {
                //得到当前线程，并打印线程的优先级
                Thread t=Thread.currentThread();
                System.out.println("线程优先级1:"+t.getPriority());
            }
        });
        System.out.println("线程优先级2:"+thread.getPriority());
        thread.start();
        System.out.println("线程优先级3："+thread.getPriority());
    }
}
